
def the_missing_n(arr):
    arr.sort()
    curr = arr[0]
    target = 0
    for i in range(1, len(arr)):
        if arr[i] - curr > 1:
            target = curr + 1
            break
        else:
            curr = arr[i]
    
    return target

list = input()
list = list.split(',')
list = [int(c) for c in list]

print(the_missing_n(list))